package com.sstir.doctor.es.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;

/**
 * <p>
 *     elk索引
 * </p>
 *
 * @author: fli
 * @email: fli@sstir.cn
 * @date: 2021/1/15 10:36
 */
@Document(indexName = "doctor",type = "_doc")
@Data
public class DoctorDoc {

    @Id
    private String id;
    /**
     * 索引内容
     */

    @MultiField(mainField = @Field(
            type = FieldType.Text
            ,analyzer = "ik_max_word")
     ,otherFields = {
            @InnerField(suffix = "keyword",type = FieldType.Keyword),
            @InnerField(suffix = "pinyin",type = FieldType.Text,analyzer = "pinyin_analyzer"),
    })
    private String key;
    /**
     * 类型
     */
    @Field(
            type = FieldType.Keyword
    )
    private String type;
    /**
     * 内容
     */
    @MultiField(mainField = @Field(
            type = FieldType.Text
            ,analyzer = "ik_max_word")
            ,otherFields = {
            @InnerField(suffix = "keyword",type = FieldType.Keyword),
            @InnerField(suffix = "pinyin",type = FieldType.Text,analyzer = "pinyin_analyzer"),
    })
    private String value;
}
